import pyecharts.options as opts
from pyecharts.charts import ThemeRiver
from pyecharts.globals import ThemeType

"""
Gallery 使用 pyecharts 1.1.0
参考地址: https://echarts.apache.org/examples/editor.html?c=themeRiver-basic

目前无法实现的功能:

1、暂时无法设置阴影样式
"""
x_data = ["甲类", "乙类", "丙类", "其他"]
y_data = [['2022/05/18', 0, '甲类'] ,
['2022/05/19', 0, '甲类'] ,
['2022/05/20', 0, '甲类'] ,
['2022/05/21', 0, '甲类'] ,
['2022/05/22', 0, '甲类'] ,
['2022/05/23', 0, '甲类'] ,
['2022/05/24', 0, '甲类'] ,
['2022/05/25', 0, '甲类'] ,
['2022/05/26', 0, '甲类'] ,
['2022/05/27', 0, '甲类'] ,
['2022/05/28', 0, '甲类'] ,
['2022/05/29', 0, '甲类'] ,
['2022/05/30', 0, '甲类'] ,
['2022/05/31', 0, '甲类'] ,
['2022/06/01', 0, '甲类'] ,
['2022/06/02', 0, '甲类'] ,
['2022/06/03', 0, '甲类'] ,
['2022/06/04', 0, '甲类'] ,
['2022/06/05', 0, '甲类'] ,
['2022/06/06', 0, '甲类'] ,
['2022/06/07', 0, '甲类'] ,
['2022/06/08', 0, '甲类'] ,
['2022/06/09', 0, '甲类'] ,
['2022/06/10', 0, '甲类'] ,
['2022/06/11', 0, '甲类'] ,
['2022/06/12', 0, '甲类'] ,
['2022/06/13', 0, '甲类'] ,
['2022/06/14', 0, '甲类'] ,
['2022/06/15', 0, '甲类'] ,
['2022/06/16', 0, '甲类'] ,
['2022/05/18', 1, '乙类'] ,
['2022/05/19', 2, '乙类'] ,
['2022/05/20', 0, '乙类'] ,
['2022/05/21', 1, '乙类'] ,
['2022/05/22', 0, '乙类'] ,
['2022/05/23', 0, '乙类'] ,
['2022/05/24', 1, '乙类'] ,
['2022/05/25', 1, '乙类'] ,
['2022/05/26', 2, '乙类'] ,
['2022/05/27', 1, '乙类'] ,
['2022/05/28', 0, '乙类'] ,
['2022/05/29', 0, '乙类'] ,
['2022/05/30', 1, '乙类'] ,
['2022/05/31', 3, '乙类'] ,
['2022/06/01', 0, '乙类'] ,
['2022/06/02', 0, '乙类'] ,
['2022/06/03', 1, '乙类'] ,
['2022/06/04', 1, '乙类'] ,
['2022/06/05', 0, '乙类'] ,
['2022/06/06', 0, '乙类'] ,
['2022/06/07', 3, '乙类'] ,
['2022/06/08', 0, '乙类'] ,
['2022/06/09', 2, '乙类'] ,
['2022/06/10', 0, '乙类'] ,
['2022/06/11', 2, '乙类'] ,
['2022/06/12', 0, '乙类'] ,
['2022/06/13', 1, '乙类'] ,
['2022/06/14', 2, '乙类'] ,
['2022/06/15', 1, '乙类'] ,
['2022/06/16', 1, '乙类'] ,
['2022/05/18', 7, '丙类'] ,
['2022/05/19', 3, '丙类'] ,
['2022/05/20', 9, '丙类'] ,
['2022/05/21', 0, '丙类'] ,
['2022/05/22', 0, '丙类'] ,
['2022/05/23', 7, '丙类'] ,
['2022/05/24', 6, '丙类'] ,
['2022/05/25', 4, '丙类'] ,
['2022/05/26', 5, '丙类'] ,
['2022/05/27', 8, '丙类'] ,
['2022/05/28', 2, '丙类'] ,
['2022/05/29', 2, '丙类'] ,
['2022/05/30', 1, '丙类'] ,
['2022/05/31', 10, '丙类'] ,
['2022/06/01', 6, '丙类'] ,
['2022/06/02', 2, '丙类'] ,
['2022/06/03', 1, '丙类'] ,
['2022/06/04', 4, '丙类'] ,
['2022/06/05', 3, '丙类'] ,
['2022/06/06', 8, '丙类'] ,
['2022/06/07', 10, '丙类'] ,
['2022/06/08', 4, '丙类'] ,
['2022/06/09', 6, '丙类'] ,
['2022/06/10', 8, '丙类'] ,
['2022/06/11', 1, '丙类'] ,
['2022/06/12', 1, '丙类'] ,
['2022/06/13', 1, '丙类'] ,
['2022/06/14', 7, '丙类'] ,
['2022/06/15', 6, '丙类'] ,
['2022/06/16', 4, '丙类'] ,
['2022/05/18', 1, '其他'] ,
['2022/05/19', 2, '其他'] ,
['2022/05/20', 3, '其他'] ,
['2022/05/21', 1, '其他'] ,
['2022/05/22', 2, '其他'] ,
['2022/05/23', 1, '其他'] ,
['2022/05/24', 4, '其他'] ,
['2022/05/25', 3, '其他'] ,
['2022/05/26', 1, '其他'] ,
['2022/05/27', 0, '其他'] ,
['2022/05/28', 0, '其他'] ,
['2022/05/29', 1, '其他'] ,
['2022/05/30', 0, '其他'] ,
['2022/05/31', 1, '其他'] ,
['2022/06/01', 2, '其他'] ,
['2022/06/02', 2, '其他'] ,
['2022/06/03', 1, '其他'] ,
['2022/06/04', 4, '其他'] ,
['2022/06/05', 3, '其他'] ,
['2022/06/06', 2, '其他'] ,
['2022/06/07', 4, '其他'] ,
['2022/06/08', 0, '其他'] ,
['2022/06/09', 0, '其他'] ,
['2022/06/10', 4, '其他'] ,
['2022/06/11', 1, '其他'] ,
['2022/06/12', 1, '其他'] ,
['2022/06/13', 0, '其他'] ,
['2022/06/14', 0, '其他'] ,
['2022/06/15', 3, '其他'] ,
['2022/06/16', 0, '其他']]

(ThemeRiver(init_opts=opts.InitOpts(theme=ThemeType.MACARONS,chart_id=1))
            .add(
                series_name=x_data,
                data=y_data,
                singleaxis_opts=opts.SingleAxisOpts(
                    pos_top="50", pos_bottom="50", type_="time"
                )
                )
            .set_global_opts(title_opts = opts.TitleOpts(title='某某疾病统计图'),
                            axispointer_opts = opts.AxisPointerOpts(
                                        is_show = True, link =[{'xAxisIndex':'all'}]
                                    ),
                            tooltip_opts=opts.TooltipOpts(trigger="axis", axis_pointer_type="line"),
                            datazoom_opts = [
                                        opts.DataZoomOpts(
                                            is_show = True,
                                            is_realtime = True,
                                            range_start = 0,
                                            range_end = 100
                            )
                                    ]
                    )
    ).render("theme_river.html")
